const http = require('http');

const url = require('url');

const qs = require('querystring');

const server = http.createServer((req,res) => {
    console.log("====")
    console.log(req.url);

    if(req.url === '/login'){
        let bufArr = [];
        req.on('data',chunk => {
            bufArr.push(chunk);
            console.log(chunk);
        })

        req.on('end',() => {
            let buf = Buffer.concat(bufArr);
            console.log(buf.toString())
            // console.log(qs.parse(str));
            req.body = buf;
        })
    }

})

server.listen(9090,() => {
    console.log("服务启动成功")
})